package com.tiny.core.resources;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

import javax.imageio.ImageIO;

/**
 * Carrega e faz cache para recursos de imagens para o jogo
 * 
 * @author Erick Zanardo
 * 
 */
public class ImageManager extends ResourceManager<BufferedImage> {

    public BufferedImage loadImage(String fileName) {
        return load(fileName);
    }

    @Override
    protected BufferedImage processUrl(URL url) {
        BufferedImage img = null;
        try {
            img = ImageIO.read(url);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
        return img;
    }
}
